
    <div class="header_top">
        <a class="back-link-icon" href="javascript:;" data-rel="back"></a>
        <h1 class="page-title-bar">交易明细</h1>
    </div>
    <!-- 公用头部 -->

    <div  id="money_container" class="payments-content page-content">
        <ul>

        </ul>
    </div>


    <script>
        $(document).ready(function(){
            var CURRENCY_SYMBOL="{Currency_Tool::symbol()}";
            var SITEURL = "{URL::site()}"
            var is_loading=false;
            var gl_page=1;
            $('#money_container').scroll( function() {
                var totalheight = parseFloat($(this).height()) + parseFloat($(this).scrollTop());
                var scrollHeight = $(this)[0].scrollHeight;//实际高度
                if(totalheight-scrollHeight>= -2){
                    get_list(parseInt(gl_page)+1);
                }
            });
            get_list(gl_page);


            function get_list(page)
            {
                if(is_loading)
                {
                    return;
                }
                is_loading=true;
                $.ajax({
                    url:SITEURL+'member/bag/ajax_get_record',
                    type:'POST', //GET
                    data:{page:page},
                    dataType:'json',
                    success:function(data,textStatus,jqXHR){
                        is_loading=false;
                        if(data.list.length==0)
                        {

                        }
                        else
                        {

                            var type_arr=['收入','支出','冻结','解冻'];
                            var html='';
                            for(var i in data.list)
                            {
                                var row=data.list[i];
                                var type=parseInt(row['type']);
                                var type_name=type_arr[type];
                                var cls=type==0||type==3?'fenxiao':'';
                                cls = type==2?'locked':cls;

                                var mark =type==0||type==3?'':'-';

                                html+='<li class="clearfix '+cls+'">';
                                html+='<i class="payments-ico"></i>';
                                html+='<div class="payments-info">';
                                html+='<div class="payments-txt">';
                                html+='<p class="na">'+row['description']+'</p>';
                                html+='<p class="tags">['+type_name+']</p>';
                                if(row.withdraw_description){
                                    html+='<p class="tags">'+row.withdraw_description+'</p>';
                                }
                                html+='<p class="time">'+row['addtime']+'</p>';
                                html+='</div>';
                                html+='<div class="payments-num">'+mark+CURRENCY_SYMBOL+row['amount']+'</div>';
                                html+='</div>';
                                html+='</li>';



                            }
                            $("#money_container ul").append(html);
                            //全局项修改
                            gl_page=data['page'];
                            var pagesize= parseInt(data.pagesize);

                        }
                    }
                })
            }
        });
    </script>
